package com.ss.android.image.a.a;

import android.graphics.drawable.Drawable;
import com.facebook.common.internal.Supplier;
import com.facebook.datasource.AbstractDataSource;
import com.facebook.drawee.controller.AbstractDraweeController;
import com.facebook.drawee.components.DeferredReleaser;

import java.util.concurrent.Executor;

public final class TTDraweeController extends AbstractDraweeController<Drawable,Drawable> {
    private Supplier<AbstractDataSource<Drawable>> mDataSourceSupplier;

    public TTDraweeController(DeferredReleaser deferredReleaser, Executor executor, Supplier supplier, String arg4, Object obj) {
        super(deferredReleaser, executor, arg4, obj);
        this.mDataSourceSupplier = supplier;
    }

    public final Drawable createDrawable(Drawable drawable) {
        return (Drawable) drawable;
    }

    public final void initialize(Supplier supplier, String arg3, Object arg4) {
        super.initialize(arg3, arg4, false);
        this.mDataSourceSupplier = supplier;
    }

    public final Drawable getImageInfo(Drawable drawable) {
        return drawable;
    }

    public final int getImageHash(Drawable drawable) {
        return drawable != null ? drawable.hashCode() : 0;
    }

    public final AbstractDataSource getDataSource() {
        return this.mDataSourceSupplier.get();
    }

    public final String toString() {
        return android.support.design.a.toStringHelper(this).add("super", super.toString()).add("dataSourceSupplier", this.mDataSourceSupplier).toString();
    }
}

